
#ifndef __TEXTURE_H__
#define __TEXTURE_H__

#include "Color.h"
#include <d3d9.h>
#include <vector>
using namespace std;

//
// Texture
//

class Texture
{
public:

	// Constructor
	Texture(TCHAR *_fileName);
	Texture(TCHAR *_fileName, Color alpha);

	// Loads the texture in
	void Load();

	// Releases Texture data
	void Release();

	// file name
	TCHAR fileName[60];

	// Clears current texture
	static void Clear();

private:

	// D3D Data type
	LPDIRECT3DTEXTURE9 texture; 

	// Currently loaded texture, prevents unnecessary loading
	static Texture *current;
};

//
// Texture Manager
//

class TextureManager
{
public:

	// Constructor
	TextureManager() {}

	// CreateTexture
	Texture *CreateTexture(TCHAR *fileName);
	Texture *CreateTexture(TCHAR *fileName, Color alpha);

	// Releases all the texture data
	void Release();

private:

	// List of all textures
	vector<Texture*> textures;
};

extern TextureManager *tManager;

#endif // __TEXTURE_H__